#pragma once
#include <QString>
#include <list>

//组合模式（Composite）;

//抽象组件;
class Component
{
public:

    //操作;  //对单个对象和组合对象操作的一致性;
    virtual void operation() = 0;

};

//叶子组件;
class Leaf : public Component
{
public:
};

//容器组件;
class Composite : public Component
{
public:
    //添加节点;
    virtual void Add(std::shared_ptr<Component> c) = 0;
	
	//移除节点;
	virtual void Remove(std::shared_ptr<Component> c)= 0;
	
	//获取节点;
    virtual std::shared_ptr<Component> GetChild(size_t index)= 0;
};

